package cn.autumnorange.app.user.api;

import cn.autumnorange.app.common.dto.ResultDto;
import cn.autumnorange.app.user.api.dto.GramtedAuthorityImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @author wsf
 * @time 2019/6/6 21:47
 */
@FeignClient(value = "app-user-provider", fallbackFactory = SysRoleFallbackFactory.class)
public interface SysRoleService {
  @GetMapping(value = "getRolesByUserId/{userId}")
  ResponseEntity<ResultDto<List<GramtedAuthorityImpl>>> getRolesByUserId(
      @PathVariable(value = "userId") long userId);

  @GetMapping(value = "/sysRole/{id}")
  ResultDto<List<GramtedAuthorityImpl>> getRolesById(@PathVariable(value = "userId") long userId);
}
